package com.woniuxy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.woniuxy.entity.GoodsManagement;

@Mapper
public interface GoodsManagementMapper {
	
	//产品管理页查询全部	
	@Select("select * from t_goods_management")
	public List<GoodsManagement> findGoodsManagements();
	
	
	//插入产品
	@Insert("insert into t_goods_management values(default,#{gmname},#{line},#{category},#{time},#{status})")
	public int addGoodsManagement(GoodsManagement goods);
	
	
	//通过gmid查询当行数据
	@Select("select * from t_goods_management where gmid = #{gmid}")
	public GoodsManagement findGoodsByGmid(int gmid);
	
	
	//修改当前数据
	@Update("update t_goods_management set gmname=#{gmname},line=#{line},category=#{category},time=#{time},status=#{status} where gmid=#{gmid}")
	public int modifyGoodsByGmid(GoodsManagement goods);
}
